import * as sdk from './fetch';

/**
 *
 * 美团相关
 *
 */
//省份查询
async function getMeituanProvince() {
  let result = await sdk.get(`/meituan/province`, {});
  return result;
}
//获取某个省份中城市信息
async function findMeituanCities(request) {
  let result = await sdk.post('/meituan/cities', {
    ...request,
  });
  return result;
}
//获取某个城市的一级类目
async function findMeituanOneCategories(request) {
  let result = await sdk.post('/meituan/oneCategories', {
    ...request,
  });
  return result;
}
//获取某个城市的一级类目包含的二级类目信息
async function findMeituanTwoCategoriesRequest(request) {
  let result = await sdk.post('/meituan/twoCategoriesRequest', {
    ...request,
  });
  return result;
}
//获取某个城市的商圈信息
async function findMeituanOneRegions(request) {
  let result = await sdk.post('/meituan/regions', {
    ...request,
  });
  return result;
}
//团购搜索
async function findMeituanSearchDeals(request) {
  let result = await sdk.post('/meituan/searchDeals', {
    ...request,
  });
  return result;
}

export default {
  findMeituanCities,
  getMeituanProvince,
  findMeituanOneCategories,
  findMeituanTwoCategoriesRequest,
  findMeituanOneRegions,
  findMeituanSearchDeals,
};

/**
 * 内容
 */
export interface BaseResponseMapStringString {
  /**
   * 结果码
   */
  code: string;
  /**
   * 内容
   */
  context?: {
    [k: string]: string;
  };
  /**
   * 错误内容
   */
  errorData?: {
    [k: string]: any;
  };
  /**
   * 消息内容
   */
  message?: string;
  /**
   * 分页
   */
  totalPages: number;
  /**
   * 数据
   */
  content: any;
}

/**
 * This interface was referenced by `IgnoreType`'s JSON-Schema
 * via the `definition` "IGetSignRequestReq".
 */
export interface IGetSignRequestReq {
  url?: string;
  [k: string]: any;
}

//create by moon https://github.com/creasy2010/moon
